<?php
function er ($output)
	{
		echo '<pre>';
		if (
			is_array ($output)
		)
			{
				print_r ($output);
			}
		else
			{
				echo $output;
			}
		echo '</pre>';
	}

function phpbb_molten_chat_parse_link ($link)
	{
		global $phpbb_root_path;

		// Get the location of the question mark.
		$index = strpos ($link, '?');

		// Get the arguments (which come after the question mark). Example: f=8&t=12
		$arguments = ($index !== false) ?
			substr ($link, ($index + 1)) :
			false;

		// Get the base link.  Example: viewtopic.php
		$link = ($index !== false) ?
			substr ($link, 0, $index) :
			$link;

		// Run the built-in phpBB 3 function: append_sid to add any local user data to it.
		$link = append_sid ($phpbb_root_path . $link, $arguments, false);

		return $link;
	}

define ('molten_chat_rooms_table', 'phpbb_chat', true);

global $config;

molten_chat_server :: $configuration ['database'] = 'phpbb';
molten_chat_server :: $configuration ['cache'] = isset (molten_chat_server :: $caching_modules [$config ['molten_chat_cache_type']]) ?
	molten_chat_server :: $caching_modules [$config ['molten_chat_cache_type']] :
	'apc';
molten_chat_server :: $callbacks ['parse_link'] = 'phpbb_molten_chat_parse_link'
?>